package com.wangbo.servlet.db;
import java.util.*;

import com.wangbo.servlet.mapping.EntityMapping;

import java.sql.*;
public class Template {
           List<Object> list = new Vector<Object>();
           PreparedStatement ps = null;
           Connection con = null;
           ResultSet rs = null;
	public List query(String sql,EntityMapping em){
		con = DBManager.getConnection();
		try {
			ps = con.prepareStatement(sql);
			rs = ps.executeQuery();
			while(rs.next()){
				list.add(em.mapping(rs));
			}
		} catch (Exception e) {
			// TODO: handle exception
		}
		
		return list;
	}
}
